package com.tang.algorithm.ordinary;

/**
 * @author tlm
 * @version 1.0
 * @date 2020/7/18 18:50
 */
public class LeetCode461 {
    public int hammingDistance(int x, int y) {
        int a = x ^ y,res = 0;
        while (a!=0){
            if((a&1)==1) res++;
            a=a>>1;
        }
        return res;
    }
}
